/*
 * @Author: lineCode
 * @Date: 2024-12-30 10:13:55
 * @LastEditors: lineCode
 * @LastEditTime: 2025-06-12 12:02:23
 */
package com.angus.modules.content.controller.work;

import com.angus.common.core.web.controller.BaseController;
import com.angus.common.core.web.domain.AjaxResult;
import com.angus.common.security.utils.SecurityUtils;
import com.angus.modules.content.dto.OrderPayDto;
import com.angus.modules.content.service.QixiangPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author liyanan
 * @date 2024/12/22 10:28 AM
 * @description
 */
@RestController
@RequestMapping("/qixiang")
public class QixiangPayController extends BaseController {

    @Autowired
    private QixiangPayService qixiangPayService;


    @PostMapping(value = "/pay")
    public AjaxResult PcPay(@RequestBody OrderPayDto dto) {
        Long userId = SecurityUtils.getUserId();
        return AjaxResult.success(qixiangPayService.qixiangPay(dto,userId));
    }

    @GetMapping("/notify")
    public String payNotify(HttpServletRequest request) {
        return qixiangPayService.qixiangNotify(request);
    }
}
